/*
题目描述
口袋中有红、黄、蓝、白、黑5种颜色的球若干个。每次从口袋中先后取出3个球，问得到3种不同颜色的球的可能取法，并输出每一种排列的情况。
要求使用枚举类型来完成本题。

输入
无

输出
对于每一种排列的情况，在一行内输出所选的三种颜色，用空格隔开。
在输出所有排列的情况之后，在最后一行输出排列的情况总数。
请注意行尾输出换行。

样例输入
复制
无
样例输出
复制
red yellow blue
red yellow white
red yellow black
red blue yellow
red blue white
red blue black
red white yellow
red white blue
red white black
red black yellow
red black blue
red black white
yellow red blue
yellow red white
yellow red black
yellow blue red
yellow blue white
yellow blue black
yellow white red
yellow white blue
yellow white black
yellow black red
yellow black blue
yellow black white
blue red yellow
blue red white
blue red black
blue yellow red
blue yellow white
blue yellow black
blue white red
blue white yellow
blue white black
blue black red
blue black yellow
blue black white
white red yellow
white red blue
white red black
white yellow red
white yellow blue
white yellow black
white blue red
white blue yellow
white blue black
white black red
white black yellow
white black blue
black red yellow
black red blue
black red white
black yellow red
black yellow blue
black yellow white
black blue red
black blue yellow
black blue white
black white red
black white yellow
black white blue
60
*/
#include <stdio.h>
#include <string.h>
enum color
{
    red,
    yello,
    blue,
    white,
    black
};
void getColorName(enum color c, char *name)
{
    switch (c)
    {
    case red:
        strcpy(name, "red");
        break;
    case yello:
        strcpy(name, "yello");
        break;
    case blue:
        strcpy(name, "blue");
        break;
    case white:
        strcpy(name, "white");
        break;
    case black:
        strcpy(name, "black");
        break;
    }
}

void printColor(enum color first, enum color second, enum color third)
{
    char firstColor[10], secondColor[10], thirdColor[10];
    getColorName(first, firstColor);
    getColorName(second, secondColor);
    getColorName(third, thirdColor);
    printf("%s %s %s\n", firstColor, secondColor, thirdColor);
}

int main()
{
    int count = 0;
    enum color first, second, third;
    for (first = red; first <= black; first++)
    {
        for (second = red; second <= black; second++)
        {
            if (second != first)
            {
                for (third = red; third <= black; third++)
                {
                    if (third != first && third != second)
                    {
                        printColor(first, second, third);
                        count++;
                    }
                }
            }
        }
    }
    printf("%d\n", count);
    return 0;
}
// 无语了怎么也过不了